/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.dusin.wufang.graph.shape;

import com.mxgraph.canvas.mxGraphics2DCanvas;
import com.mxgraph.shape.mxBasicShape;
import com.mxgraph.view.mxCellState;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;

/**
 * 水平母线
 * @author Admin
 */
public class HBusLine10 extends mxBasicShape{
    private static final int width = 10;   //母线 ，线宽10像素
    	public void paintShape(mxGraphics2DCanvas canvas, mxCellState state){
            Rectangle rect = state.getRectangle();
		int x = rect.x;
		
		int w = rect.width;
		int h = rect.height;                
                int y = rect.y+(h-width)/2;
                if (configureGraphics(canvas, state, false))
		{
                        Graphics2D g2d = canvas.getGraphics();
                        //Color oldColor = g2d.getColor();
                        //g2d.setColor(Color.red);
			canvas.getGraphics().fillRect(x, y, w, width);
                        //g2d.setColor(oldColor);
		}   
                
        }

}
